﻿@using Smartstore.Web.Models.Catalog

@model ProductDetailsModel

@{
    string updateUrl = Url.Action("UpdateProductDetails", "Product", new
    {
        productId = Model.Id,
        bundleItemId = Model.BundleItem.Id,
        itemType = "associateditem"
    });

    var gallery = Model.MediaGalleryModel;
    var img = gallery.Files?.FirstOrDefault();
}

<hr />

<article class="pd-variant row update-container" data-url="@updateUrl" itemscope itemtype="http://schema.org/Product">
    <div class="col-4 col-sm-6 col-lg-3">
        <div class="pd-variant-picture img-center-container">
            @if (img != null)
            {
                <img class="pd-dyn-thumb" src="@img.GetUrl(gallery.ImageSize)" alt="@(img?.Alt)" title="@(img?.TitleAttribute)" />
            }
            else if (gallery.FallbackUrl.HasValue())
            {
                <img class="pd-dyn-thumb" src="@gallery.FallbackUrl" alt="@gallery.DefaultAlt" />
            }
        </div>
    </div>
    <div class="col-8 col-sm-6 col-lg-4">
        <!-- Title/Brand/ReviewSummary -->
        <partial name="Product.Info" model="Model" />

        <!-- Product attributes (SKU, EAN, Weight etc.) -->
        <div class="pd-attrs-container" data-partial="Attrs">
            <partial name="Product.Attrs" model="Model" />
        </div>
    </div>
    <div class="col col-lg-5 d-flex">
        <!-- Offer box -->
        <partial name="Product.Offer" model="Model" />
    </div>
</article>